//
//  JXLSportTracking.h
//  JXLSport
//
//  Created by 贾晓磊 on 16/10/24.
//  Copyright © 2016年 贾晓磊. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "JXLSportTrackingLine.h"
#import "JXLSportPolyLine.h"
//运动类型枚举
typedef enum: NSInteger {
    JXLSportTypeRun,
    JXLSportTypeWalk,
    JXLSportTypeBike,
} JXLSportType;

//运动状态枚举
typedef NS_ENUM(NSInteger,JXLSportState) {
    JXLSportStatePause,
    JXLSportStateContinue,
    JXLSportStateFinish,
};

//单次运动轨迹追踪模型
@interface JXLSportTracking : NSObject
//运动类型
@property (nonatomic,assign,readonly) JXLSportType sportType;

//运动状态
@property (nonatomic,assign) JXLSportState sportState;

/**
 运动的起点
 */
@property (nonatomic,readonly) CLLocation *sportStartLocation;

//运动图像
@property (nonatomic,readonly) UIImage *sportImage;

//平均速度
@property (nonatomic,readonly) double avgSpeed;

//最大速度
@property (nonatomic,readonly) double maxSpeed;

//总时长
@property (nonatomic,readonly) double totalTime;

//总时长字符串
@property (nonatomic,readonly) NSString *totalTimeString;

//总距离
@property (nonatomic,readonly) double totalDistance;

/**
 使用运动类型实例化追踪模型
 
 @param  sportType 运动类型
 
 @param  sportState 运动状态
 
 @return 追踪模型
 */
- (instancetype)initWithSportType:(JXLSportType )sportType sportState:(JXLSportState )sportState;

/**
 追加当前用户位置，返回折线模型

 @param location location  location

 @return 折线模型
 */
- (JXLSportPolyLine *)appendLocation:(CLLocation *)location;
@end
